package com.netty.httpserver;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.codec.http.HttpResponseEncoder;

public class MyChannelInitializer extends ChannelInitializer<SocketChannel> {

	@Override
	protected void initChannel(SocketChannel ch) throws Exception {
		ch.pipeline().addLast(new HttpRequestDecoder());  //Http请求入站解码
		ch.pipeline().addLast(new HttpResponseEncoder()); //Http响应出站编码
		ch.pipeline().addLast(new MyHandler());
		
	}
	


}
